Getting an OAuth access token from the authorization code

After an administrator authorizes a web services client application, the client application does the rest of the work. First, the authorization code is exchanged for the access token.

To get an OAuth access token from the authorization code

  1. Parse the URI that is returned from the authorization request response to determine the authorization code. The URI looks like the following:

    https://hostname:port_number​/sepm?code=authorization_code_string

  2. Exchange the authorization code for an access token by including it in a URL query parameter. The URL looks like the following:

    https://hostname:port_number​/sepm/oauth/token?grant_type=authorization_code&​client_id=client_id&client_secret=client_secret​&redirect_uri=https://hostname:port_number/sepm&code=authorization code

    where client_id and client_secret are the client ID and client secret that were obtained when the client application was registered with Symantec Endpoint Protection Manager.

    The return result is a JSON formatted object that contains the following information. These details are for example only. Expiration is measured in seconds.

    token_type:    bearer
    access_token:  0798f706-0046-417c-9af0-513b8dbb1fc7
    refresh_token: b8fe1e5c-e852-4104-bb78-43dd2022f426
    expires_in:    43199
    

See Including the OAuth token in calls to web services.

See Using OAuth with Symantec Endpoint Protection Manager web services.

See OAuth flow.

See OAuth implementation reference.